package com.practice.mybatis.v2.executor;

import com.practice.mybatis.v2.config.Configuration;

public class ExecutorFactory {

    private static final String SIMPLE = "SIMPLE";

    public static Executor DEFAULT(Configuration configuration) {
        return get(SIMPLE, configuration);
    }

    public static Executor get(String key, Configuration configuration) {
        if (SIMPLE.equalsIgnoreCase(key)) {
            return new SimpleExecutor(configuration);
        }
        throw new RuntimeException("no executor found");
    }

    public enum ExecutorType {
        SIMPLE,CACHING
    }
}
